Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache loaded repos in ProvisioningContext #517

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

laeubi
Copy link
Member

@laeubi laeubi commented May 16, 2024

Currently if fetching updates the provision context is queried multiple times leading to the repositories loaded multiple times, even though this is usually faster as repo are cached this still produces unnecessary workload, especially if there is one failed repository it will be tried to be loaded over and over again.

This now caches the repositories loaded on first access to speed that up.

Copy link

github-actions bot commented May 16, 2024

Test Results

  375 files  ±0    375 suites  ±0   47m 54s ⏱️ +59s
1 895 tests ±0  1 891 ✅  - 1  3 💤 ±0  1 ❌ +1 
6 685 runs  ±0  6 673 ✅  - 3  9 💤 ±0  3 ❌ +3 

For more details on these failures, see this check.

Results for commit 5bc1d2d. ± Comparison against base commit 385d266.

♻️ This comment has been updated with latest results.

@laeubi laeubi requested a review from merks May 16, 2024 05:55
@merks
Copy link
Contributor

merks commented May 16, 2024

I guess this same problem doesn't arise for ProvisioningContext.getLoadedArtifactRepositories(IProgressMonitor)?

One concern I have here is that one can call org.eclipse.equinox.p2.engine.ProvisioningContext.setMetadataRepositories(URI...) in the API and result of getLoadedMetadataRepositories depends on that value so probably it would be most proper to clear the cache when that setter is called.

@laeubi
Copy link
Member Author

laeubi commented May 16, 2024

The ProvisionContext is kind of messy... e.g. it says

The provisioning context has a distinct lifecycle, whereby the metadata and artifact repositories to be used are determined when the client retrieves retrieves the metadata queryable. Clients should not reset the list of metadata repository cations or artifact repository locations once the metadata queryable has been retrieved.

in fact the artifact repositories are only loaded fully when the metadata is queried and so on.

Of course this "distinct lifecycle" is no where described :-\

Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

repositorie is spelled wrong, but it was that way before. 😱

@laeubi laeubi force-pushed the cahce_loaded_repos branch 2 times, most recently from 5b126d4 to 85b0b03 Compare June 16, 2024 05:02
Currently if fetching updates the provision context is queried multiple
times leading to the repositories loaded multiple times, even though
this is usually faster as repo are cached this still produces
unnecessary workload, especially if there is one failed repository it
will be tried to be loaded over and over again.

This now caches the repositories loaded on first access to speed that
up.
Currently ProvisioningContextTest.testFollowHelpsResolve() assumes it
can modify the context repositories after using the context but this is
not valid according to API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants